package com.itlong.cloud.smartcard.resource;

import com.itlong.cloud.project.smartcard.ISmartCardPropertyValueServiceClient;
import com.itlong.cloud.smartcard.service.ISmartCardPropertyValueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.Map;

/**
 * <desc>
 *      一卡通物业增值业务暴露接口实现类
 * </desc>
 *
 * @createDate 2019/06/13
 */
@RestController
public class SmartCardPropertyValueServiceResource implements ISmartCardPropertyValueServiceClient {

    @Autowired
    ISmartCardPropertyValueService iSmartCardPropertyValueService;

    /**
     * <desc>
     *      获取项目下的楼栋单元房间信息
     * </desc>
     *
     * @param json
     * @return
     * @author Jiaqi.X
     * @createDate 2019/06/12
     */
    @Override
    @RequestMapping(path = "/smartcard/property/value/getBuildAndUnitAndRoomInfo",method = RequestMethod.POST)
    public Map<String, Object> getBuildAndUnitAndRoomInfo(@RequestParam("json") String json) throws IOException {
        return iSmartCardPropertyValueService.getBuildAndUnitAndRoomInfo(json);
    }


    /**
     * <desc>
     *      保存软卡号
     * </desc>
     *
     * @param json
     * @return
     * @author Jiaqi.X
     * @createDate 2019/06/13
     */
    @RequestMapping(path = "/smartcard/property/value/saveSoftCardNo",method = RequestMethod.POST)
    @Override
    public Integer saveSoftCardNo(@RequestParam("json") String json) throws Exception {
        return iSmartCardPropertyValueService.saveSoftCardNo(json);
    }
}
